/**
 * 计算逻辑
 * @author 
 *
 */
class ComputerLogic {
    public multiplier: number; //乘数
    public multiplicand: number; //被乘数
    public product: number; //积
    private answer: number; //回答
    public bingo: boolean; //正确
    private bingoNum: number = 0;
    private wrongNum: number = 0;
	public constructor() {
	}
	public addCom() {
        this.multiplier = Math.ceil(Math.random() * 10);
        this.multiplicand = Math.ceil(Math.random() * 10);
        this.product = this.multiplier + this.multiplicand;
	}
	public onBingo(answer: number):boolean {
        this.answer = answer;
        if(this.answer == this.product) {
            this.bingo = true;
            this.bingoNum += 1;
            return true;
        }
            this.bingo = false;
            this.wrongNum += 2;
            return false;
	}
}
